home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
400_01
/
socketpp-1.5
/
test
/
thostnames.cc
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1993-11-06
|
356 b
|
19 lines
#include <sockinet.h>
main(int ac, char** av)
{
if (ac != 2) {
cerr << "USAGE: " << av[0] << " hostname\n";
return 1;
}
iosockinet sio(sockbuf::sock_stream);
sockinetaddr sina("nic.ddn.mil", "hostnames", "tcp");
sio->connect(sina);
sio << "HNAME " << av[1] << "\r\n";
char buf[1024];
while (sio.getline(buf, 1023)) cout << buf << endl;
}